<template>
  <div style="height: 100%">
    <button style="width: 100%;height: 100%;border: none" @click="redirect()"
            :style="{background:option.attribute.bgColor,color:option.attribute.textColor,
              borderRadius:option.attribute.radius+'px'}">
      {{option.title}}
    </button>
  </div>
</template>
<script>
  import {getDataJson} from "@/components/design/utils/refreshCptData";
  export default {
    name: 'cpt-menu',
    title: "菜单",
    icon: 'button',
    initWidth: 150,
    initHeight: 50,
    group:'basic',
    props:{option:Object},
    data() {
      return {
        cptData: {},
        uuid: null
      }
    },
    methods: {
      redirect() {
        let that = this;
        this.$router.push(that.option.path)
      },
      loadData(){
        getDataJson(this.option.cptDataForm).then(res => {
          this.cptData = res;
        });
      },
    },
    mounted() {
      this.uuid = require('uuid').v1();
      this.loadData();
    }
  }
</script>

<style scoped>

</style>